#ifndef __bootload_H
#define __bootload_H
#include "stm32f1xx_hal.h"

#define DEBUG   printf

#define APPLICATION_BASE_ADDR   ((uint32_t)0x08000000)
#define APPLICATION_ADDR        ((uint32_t)0x08004000)
#define APPLICATION_PACK_ADDR   ((uint32_t)0x08006000)
#define FIRMWARE_START_ADDR     ((uint32_t)0x0801E000)
#define FIRMWARE_DEV_ADDR       ((uint32_t)0x0803E800)
#define FIRMWARE_SIZE_ADDR      (FIRMWARE_DEV_ADDR + 4)
#define FIRMWARE_VERSION        (FIRMWARE_SIZE_ADDR + 4)
#define PAGE_SIZE               (2048)
#define FIRMWARE_SIZE_MAX       (102400)
#define REBOOT (SCB->AIRCR = 0X05FA0000 | (uint32_t)0x04)

//extern void BootLoadMain(void);
extern void BootLoadJumpToApplication(uint32_t u32AppAddr);
extern void BootLoadJumpToApp(uint32_t u32AppAddr);
extern void BootLoadToFlash(uint8_t *data,uint32_t len,uint32_t Address) ;

#endif
